package components.resultLayer
{
	import UIFree.uif_bitmap;
	import UIFree.uif_component;
	
	import flash.events.Event;
	import flash.filters.GlowFilter;

	public class clt_selectedBmp extends uif_bitmap {
		private var _source: clt_elemBitmap;
		private var _state: Number;
		public function clt_selectedBmp(parent: uif_component) {
			super();
			_state = 0;
			filters = [
				new GlowFilter(0x00FF00, 1, 3, 3, 3, 1, false, true)
			]
			addEventListener(Event.ENTER_FRAME, doEnterFrame);
			parent.addChild(this);
			visible = false;
		}
		
		override public function set visible(value:Boolean):void {
			super.visible = value;
			_state = 0;
		}
		
		protected function doEnterFrame(e: Event): void {
			if (visible) {
				var _filters: Array = filters;
				(_filters[0] as GlowFilter).alpha = (Math.sin(_state) + 1) / 2;
				filters = _filters;
				_state += 0.15;		
			}
		}
	}
}